﻿using AutoMapper;
using Domain.Dto.Selectors;
using Domain.Dto.SiteMap;
using Domain.Model;

namespace Web.Profiles
{
    public class WebScraperProfile : Profile
    {
        public WebScraperProfile()
        {
            CreateMap<SiteMap, SiteMapDto>();
            CreateMap<SiteMapDto, SiteMap>();
            CreateMap<Selector, SelectorResponseDto>();
            CreateMap<SelectorRequestDto, Selector>()
                .ForMember(dest=>dest.ParentSelectorNames,opt=>opt.MapFrom(src=>string.Join(",", src.ParentSelectorNames)));
        }
    }
}
